# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.ContentWarehouse.V1.Model.CloudAiPlatformTenantresourceTenantProjectResource do
  @moduledoc """
  The tenant project and tenant resources. Next ID: 10

  ## Attributes

  *   `cloudSqlInstances` (*type:* `list(GoogleApi.ContentWarehouse.V1.Model.CloudAiPlatformTenantresourceCloudSqlInstanceConfig.t)`, *default:* `nil`) - The CloudSQL instances that are provisioned under the tenant project.
  *   `gcsBuckets` (*type:* `list(GoogleApi.ContentWarehouse.V1.Model.CloudAiPlatformTenantresourceGcsBucketConfig.t)`, *default:* `nil`) - The GCS buckets that are provisioned under the tenant project.
  *   `iamPolicyBindings` (*type:* `list(GoogleApi.ContentWarehouse.V1.Model.CloudAiPlatformTenantresourceIamPolicyBinding.t)`, *default:* `nil`) - The dynamic IAM bindings that are granted under the tenant project. Note: this should only add new bindings to the project if they don't exist and the existing bindings won't be affected.
  *   `infraSpannerConfigs` (*type:* `list(GoogleApi.ContentWarehouse.V1.Model.CloudAiPlatformTenantresourceInfraSpannerConfig.t)`, *default:* `nil`) - The Infra Spanner databases that are provisioned under the tenant project. Note: this is an experimental feature.
  *   `tag` (*type:* `String.t`, *default:* `nil`) - Input/Output [Required]. The tag that uniquely identifies a tenant project within a tenancy unit. Note: for the same tenant project tag, all tenant manager operations should be idempotent.
  *   `tenantProjectConfig` (*type:* `GoogleApi.ContentWarehouse.V1.Model.CloudAiPlatformTenantresourceTenantProjectConfig.t`, *default:* `nil`) - The configurations of a tenant project.
  *   `tenantProjectId` (*type:* `String.t`, *default:* `nil`) - Output only. The tenant project ID that has been created.
  *   `tenantProjectNumber` (*type:* `String.t`, *default:* `nil`) - Output only. The tenant project number that has been created.
  *   `tenantServiceAccounts` (*type:* `list(GoogleApi.ContentWarehouse.V1.Model.CloudAiPlatformTenantresourceTenantServiceAccountIdentity.t)`, *default:* `nil`) - The service account identities (or enabled API service's P4SA) that are expclicitly created under the tenant project (before JIT provisioning during enabled API services).
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :cloudSqlInstances =>
            list(
              GoogleApi.ContentWarehouse.V1.Model.CloudAiPlatformTenantresourceCloudSqlInstanceConfig.t()
            )
            | nil,
          :gcsBuckets =>
            list(
              GoogleApi.ContentWarehouse.V1.Model.CloudAiPlatformTenantresourceGcsBucketConfig.t()
            )
            | nil,
          :iamPolicyBindings =>
            list(
              GoogleApi.ContentWarehouse.V1.Model.CloudAiPlatformTenantresourceIamPolicyBinding.t()
            )
            | nil,
          :infraSpannerConfigs =>
            list(
              GoogleApi.ContentWarehouse.V1.Model.CloudAiPlatformTenantresourceInfraSpannerConfig.t()
            )
            | nil,
          :tag => String.t() | nil,
          :tenantProjectConfig =>
            GoogleApi.ContentWarehouse.V1.Model.CloudAiPlatformTenantresourceTenantProjectConfig.t()
            | nil,
          :tenantProjectId => String.t() | nil,
          :tenantProjectNumber => String.t() | nil,
          :tenantServiceAccounts =>
            list(
              GoogleApi.ContentWarehouse.V1.Model.CloudAiPlatformTenantresourceTenantServiceAccountIdentity.t()
            )
            | nil
        }

  field(:cloudSqlInstances,
    as: GoogleApi.ContentWarehouse.V1.Model.CloudAiPlatformTenantresourceCloudSqlInstanceConfig,
    type: :list
  )

  field(:gcsBuckets,
    as: GoogleApi.ContentWarehouse.V1.Model.CloudAiPlatformTenantresourceGcsBucketConfig,
    type: :list
  )

  field(:iamPolicyBindings,
    as: GoogleApi.ContentWarehouse.V1.Model.CloudAiPlatformTenantresourceIamPolicyBinding,
    type: :list
  )

  field(:infraSpannerConfigs,
    as: GoogleApi.ContentWarehouse.V1.Model.CloudAiPlatformTenantresourceInfraSpannerConfig,
    type: :list
  )

  field(:tag)

  field(:tenantProjectConfig,
    as: GoogleApi.ContentWarehouse.V1.Model.CloudAiPlatformTenantresourceTenantProjectConfig
  )

  field(:tenantProjectId)
  field(:tenantProjectNumber)

  field(:tenantServiceAccounts,
    as:
      GoogleApi.ContentWarehouse.V1.Model.CloudAiPlatformTenantresourceTenantServiceAccountIdentity,
    type: :list
  )
end

defimpl Poison.Decoder,
  for: GoogleApi.ContentWarehouse.V1.Model.CloudAiPlatformTenantresourceTenantProjectResource do
  def decode(value, options) do
    GoogleApi.ContentWarehouse.V1.Model.CloudAiPlatformTenantresourceTenantProjectResource.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.ContentWarehouse.V1.Model.CloudAiPlatformTenantresourceTenantProjectResource do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
